package com.slz3.business.module.socialManagement.socShow.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.socialManagement.socShow.domain.SocShow;
import com.slz3.business.module.socialManagement.socShow.domain.SocShowFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class SocShowTransactionalServiceImpl implements SocShowTransactionalService {

    @Override
    public SocShow modify(SocShow socShowNew) {
        Repositorys.socShow.test();
        Repositorys.socShow.save(SocShowFactory.initBaseFields());
        System.err.println(1/0);
        socShowNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.socShow.saveAndFlush(socShowNew);
    }

    @Override
    public List<SocShow> batchModify(List<SocShow> socShowList) {
        return Repositorys.socShow.saveAll(socShowList);
    }
}
